#include <stdio.h>
int ok(int n) {
  int a, b, c, tot;
  a = n / 100;
  b = (n % 100) / 10;
  c = n % 10;
  return (a *a * a + b * b * b + c * c * c == n);
}

int main() {
  int n, start = 100, end = 999, tot = 0;
  for (n = start; n <= end; n++) {
    if (ok(n)) {
      printf("%d ", n);
      ++tot;
    }
  }
  printf("\ntot=%d\n", tot);
  return 0;
}
